﻿using System.Linq;
using System.Windows;
using System.Windows.Controls;

using AnythingTheyCanDo.LinqToDom;
namespace test
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //HtmlPage.Document.GetElementById("test").AsParentNode();

            // example of how to grab all the divs that live under a from and have an id that is set
            jQuery q = new jQuery("form > div");
            var divsInFormWithIds = from div in q.Nodes
                        where div.HasId
                        select div;
            
            // sample of getting all the paragraphs that have a class of example 
            q = new jQuery("*");
            var ExampleClassParagraph = from node in q.Nodes
                                       where node.CssClasses.Contains("example") &&
                                       node.NodeType == "p"
                                       select node;

        }
    }
}
